package com.leetcode.LC;

public class LC492 {
    public int[] constructRectangle(int area) {
        if (area==0){
            return new int[1];
        }

        //对初始数据进行开根

        int num = (int) Math.sqrt(area);
        while (area % num != 0) {
            num--;
        }

        return new int[]{area / num, num};

    }

    public static void main(String[] args) {
        for (int i : new LC492().constructRectangle(9999999)) {
            System.out.print(i + ",");
        }
    }
}
